<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>函数</title>
    <style>
            #box{
                background-color: yellowgreen;
                width: 100px;
                height: 200px;
                position: absolute;
            }
    </style>
</head>
<body>
        <div id="box"></div>
        <input type="button" id="btn" value="点我">
        <script>
            /*
            * 函数名，字母下划线，$开始，后可以跟上任意个字母、数字、下划线、$
            * 注意不能使用关键字，不能用if for while  do
            * $
            * -
            * $ff
            * fun
            *
            * */
            function $(id) {
                return  document.getElementById(id);
            }
            function getCSSAttr(obj,attr) {
                var tmpobj = window.getComputedStyle(obj);
                var t = tmpobj[attr];
                //如果包含px,我们进行数据转换
                if(t.search('px')!=-1){
                    t = parseInt(t);
                }
                return t;
            }
            var box = $('box');
            var btn = $('btn');
            console.log(box);
            console.log(btn);
            console.log(box.style.backgroundColor);

            var ossobj = window.getComputedStyle(box);

            console.log()
















        </script>
</body>
</html>